#include "system.h"
#include "assert.h"

#ifdef ASSERT

void assertionFailure(char *exp, char *file, char *baseFile, int line)
{
	if (!strcmp(file, baseFile)) {
		puts("Assert(");
		puts(exp);
		puts(") failed in file ");
		puts(file);
		puts(", line ");
		puti(line);
		putc('\n');
		/*fprintf(stderr, 
 			"Assert(%s) failed in file %s, line %d\n", exp, file, line); */
	} else {
		puts("Assert(");
		puts(exp);
		puts(") failed in file ");
		puts(file);
		puts("(included from ");
		puts(baseFile);
		puts("), line ");
		puti(line);
		putc('\n');
		/*fprintf(stderr,
				"Assert(%s) failed in file %s (included from %s), line %d\n",
				exp, file, baseFile, line);*/
	}
}

#endif
